﻿<UserControl x:Class="WpfApplication1.AccountSelector"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignWidth="300"
             Height="25">
    <StackPanel Orientation="Vertical">
        <TextBox Name="txtCity"
                 Height="25"
                 TextChanged="TextBox_TextChanged"
                 GotFocus="txtCity_GotFocus"
                 LostFocus="txtCity_LostFocus"
                 KeyUp="txtCity_KeyUp"
                 KeyDown="txtCity_KeyDown" />
        <Popup Name="PopupControl"
               IsOpen="False"
               HorizontalAlignment="Stretch">
            <TreeView Name="tvData"
                      Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=Width}"
                      SelectedItemChanged="tvData_SelectedItemChanged"
                      KeyDown="tvData_KeyDown"
                      GotFocus="tvData_GotFocus"
                      LostFocus="tvData_LostFocus"
                      MouseLeftButtonUp="tvData_MouseLeftButtonUp" />
        </Popup>
    </StackPanel>
</UserControl>
